Skip to content

Fix desktop appcast endpoint to support 2-component version tags#5286

Closed
atlas-agent-omi[bot] wants to merge 1 commit intomainfrom
atlas/fix-desktop-release-tag-pattern
Closed

Fix desktop appcast endpoint to support 2-component version tags#5286
atlas-agent-omi[bot] wants to merge 1 commit intomainfrom
atlas/fix-desktop-release-tag-pattern

Conversation

@atlas-agent-omi
Copy link

Summary

Fixes #5285

The desktop appcast endpoint (/v2/desktop/appcast.xml) was failing to recognize new macOS release tags that use a 2-component version format (v11.0+11000-macos instead of v1.0.77+464-macos).

Changes

backend/routers/updates.py

  • Updated _parse_desktop_version() regex to make the patch version optional
  • Changed from: v{major}.{minor}.{patch}+{build} (required 3 components)
  • Changed to: v{major}.{minor}[.{patch}]+{build} (patch is optional)
  • Default patch to '0' when not present

backend/tests/unit/test_desktop_version_parser.py (new)

  • Added comprehensive unit tests for all supported tag formats
  • Tests cover old 3-component tags, new 2-component tags, and edge cases

Supported Tag Formats

After this fix, the parser correctly handles:

Old 3-component format:

  • v1.0.77+464-desktop-cm
  • v0.11.38+11038-macos
  • 0.11.41+1100-macos (without v prefix)

New 2-component format:

  • v11.0+11000-macos
  • v11.3+11003-macos

Correctly rejects:

  • Firmware tags: Omi_CV1_v3.0.15
  • Invalid formats: v1.0.77-macos (missing build number)

Testing

All unit tests pass:

✓ PASS: v1.0.77+464-desktop-cm         -> 1.0.77+464
✓ PASS: v11.0+11000-macos              -> 11.0.0+11000
✓ PASS: v11.3+11003-macos              -> 11.3.0+11003
✓ PASS: v0.11.38+11038-macos           -> 0.11.38+11038
✓ PASS: 0.11.41+1100-macos             -> 0.11.41+1100
✓ PASS: v1.0.524+614-desktop-auto      -> 1.0.524+614
✓ PASS: Omi_CV1_v3.0.15                -> correctly rejected
✓ PASS: v1.0.77-macos                  -> correctly rejected

Impact

Desktop releases using the 2-component version format will now be included in the appcast feed, enabling auto-updates for users on these versions.

- Update regex to make patch version optional (major.minor or major.minor.patch)
- Default patch to '0' when not present (e.g., v11.0+11000-macos)
- Add comprehensive unit tests for all supported tag formats
- Fixes #5285
@atlas-agent-omi atlas-agent-omi bot added bug Something isn't working backend Backend Task (python) labels Mar 3, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 3, 2026

Greptile Summary

This PR successfully fixes the desktop appcast endpoint to support 2-component version tags (e.g., v11.0+11000-macos) in addition to the existing 3-component format (e.g., v1.0.77+464-macos).

Key Changes

  • Regex pattern update: Made patch version optional using (?:\.(\d+))? and defaults to '0' when not present
  • Backward compatibility: Maintains full support for existing 3-component version tags
  • Comprehensive tests: Covers old formats, new formats, edge cases, and rejection scenarios

Technical Implementation

The change is minimal and focused:

  • Updated _parse_desktop_version() regex from requiring 3 components to making patch optional
  • Added default value logic: patch = patch or '0'
  • Version output format remains consistent: major.minor.patch+build

Test Coverage

Tests verify:

  • ✅ Old 3-component formats with -cm, -auto, and platform suffixes
  • ✅ New 2-component formats (v11.0, v11.3)
  • ✅ Tags with/without v prefix
  • ✅ Different platforms (desktop, macos, windows, linux)
  • ✅ Rejection of invalid formats (firmware tags, missing build numbers)

The implementation is sound and will enable auto-updates for desktop releases using the new version format.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is minimal, focused, and backward compatible. The regex modification correctly makes patch version optional while maintaining all existing functionality. Comprehensive unit tests verify all supported formats and edge cases. Only minor style improvement needed in test imports.
  • No files require special attention

Important Files Changed

Filename Overview
backend/routers/updates.py Regex pattern updated to support optional patch version in desktop version tags, backward compatible change
backend/tests/unit/test_desktop_version_parser.py Comprehensive unit tests covering all supported tag formats, has minor style inconsistency with import pattern

Last reviewed commit: d1ecd1a

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +6 to +7
# Add backend to path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sys.path.insert is unnecessary. Other test files in the project (e.g., test_firmware_pagination.py, test_geocoding_cache.py) import directly from modules without path manipulation, relying on pytest's pythonpath = ["."] configuration in pyproject.toml. Remove these lines and keep only the import statement.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@beastoin
Copy link
Collaborator

Closing — this is a non-issue. The v11.0 tag is an orphan tag not on the main branch; the release workflow only creates v*-macos tags from main, so the appcast endpoint will never see a 2-component version. See analysis in #5285.


by AI for @beastoin

@beastoin beastoin closed this Mar 10, 2026
@github-actions
Copy link
Contributor

Hey @atlas-agent-omi[bot] 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our roadmap and vision

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community! 💜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend Task (python) bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop appcast endpoint fails to match new macOS release tag format

1 participant